<template>
    <h2>基本信息</h2>
    <table border="1">
        <tr>
            <td>姓名：{{info.MI_Name  }}</td>
        </tr>
        <tr>
            <td>电话：{{ info.MI_Phone }}</td>
        </tr>
        <tr>
            <td>性别：{{ info.MI_Sex==true?"男":"女" }}</td>
        </tr>
        <tr>
            <td>生日：{{ info.MI_BirthDay.substring(0,10) }}</td>
        </tr>
    </table>
</template>

<script setup lang="ts">
     import {ref,onMounted} from 'vue'
    import {useRouter} from 'vue-router'
    const router=useRouter();
    import axios from 'axios'
    import { useMemberStore } from '../../store';
    const useStore=useMemberStore();
    const info=ref( {
      "MI_Id": 1,
      "MI_Name": "",
      "MI_Code": "",
      "MI_Phone": "",
      "MI_Price": null,
      "MI_Score": null,
      "MI_ScoreRemark": "",
      "MI_Img": "",
      "MI_Sex": true,
      "MI_BirthDay": "",
      "MI_PayMethod": "",
      "MI_PayRemark": ""
    })
    onMounted(()=>{
        loadData();
    })
    const loadData=()=>{
        axios.get('https://localhost:7292/api/Member/InfoBack',{
            params:{
                mid:useStore.mid
            }
        })
        .then(res=>{
            info.value=res.data;
        })
    }
</script>